import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/widgets/form/form_edit_status_inherited_widget.dart';
import 'package:finance_app/src/widgets/wrapper/normal_form_wrapper.dart';
import 'package:flutter/material.dart';

class BetweenItemForm extends StatelessWidget {
  final String left;
  final String right;
  final VoidCallback onTap;
  final bool isDisable;
  final bool hasBottomBorder;
  final Color textColor;

  BetweenItemForm(
      {Key key,
      this.left,
      this.isDisable = false,
      this.textColor,
      this.right,
      this.hasBottomBorder = true,
      this.onTap})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      onPressed: () {
        if (FormEditStatusInheritedWidget.ofEnable(context)) onTap?.call();
      },
      child: NormalFormWrapper(
        topPadding: getDp(19),
        bottomPadding: getDp(19),
        hasBottomBorder: hasBottomBorder,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              left ?? '',
              style: FormEditStatusInheritedWidget.ofStyle(context, isDisable)
                  .copyWith(color: textColor),
            ),
            Text(
              right??'',
              style: FormEditStatusInheritedWidget.ofStyle(context, isDisable)
                  .copyWith(color: textColor),
            ),
          ],
        ),
      ),
    );
  }
}
